package ee.ut.sysmodel.bgmn;
import java.util.Random;

import javax.swing.JFrame;

import ee.ut.sysmodel.bgmn.model.DiceResult;
import ee.ut.sysmodel.bgmn.model.Player;
import ee.ut.sysmodel.bgmn.model.Session;
import ee.ut.sysmodel.bgmn.ui.Frame;



public class Test {
	
	
	public static void main(String[] args) {
		Test t = new Test();
		t.start();
	}
	
	private static final boolean decideWhosFirst(){
		return new Random().nextBoolean();
	}
	
	public void start(){
		
		Player p1 = new Player(Player.Identity.PLAYER_ONE);
		Player p2 = new Player(Player.Identity.PLAYER_TWO);
		Session session =  null;
		
		DiceResult[] dice = Session.rollDice();
		
		
		if(decideWhosFirst()){
			 session = new Session(p1, p2, dice);
		} else {
			 session = new Session(p2, p1, dice);
		}
		
		JFrame frame = new Frame(session);	

	}
}
